/**
 * 
 */
package com.ums.core.entity.user;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author soulMate
 *
 */
public class User implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private long userId;
	private String username;
	private String password;
	private String userTypeId;
	private String status;
	private String isAccountLocked;
	private String isActive;
	private String firstName;
	private String middleName;
	private String lastName;
	private long createdBy;
	private Date createDate;
	private long lastModifiedBy;
	private Date lastModifyDate;
	private String isSystemRecord;
	private List<AddressDetail> addrList = new ArrayList<AddressDetail>();
	
	public User() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * @return the userId
	 */
	public long getUserId() {
		return userId;
	}



	/**
	 * @param userId the userId to set
	 */
	public void setUserId(long userId) {
		this.userId = userId;
	}



	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}



	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}



	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}



	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}



	/**
	 * @return the userTypeId
	 */
	public String getUserTypeId() {
		return userTypeId;
	}



	/**
	 * @param userTypeId the userTypeId to set
	 */
	public void setUserTypeId(String userTypeId) {
		this.userTypeId = userTypeId;
	}



	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}



	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}



	/**
	 * @return the isAccountLocked
	 */
	public String getIsAccountLocked() {
		return isAccountLocked;
	}



	/**
	 * @param isAccountLocked the isAccountLocked to set
	 */
	public void setIsAccountLocked(String isAccountLocked) {
		this.isAccountLocked = isAccountLocked;
	}



	/**
	 * @return the isActive
	 */
	public String getIsActive() {
		return isActive;
	}



	/**
	 * @param isActive the isActive to set
	 */
	public void setIsActive(String isActive) {
		this.isActive = isActive;
	}



	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}



	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}



	/**
	 * @return the middleName
	 */
	public String getMiddleName() {
		return middleName;
	}



	/**
	 * @param middleName the middleName to set
	 */
	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}



	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}



	/**
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}



	/**
	 * @return the createdBy
	 */
	public long getCreatedBy() {
		return createdBy;
	}



	/**
	 * @param createdBy the createdBy to set
	 */
	public void setCreatedBy(long createdBy) {
		this.createdBy = createdBy;
	}



	/**
	 * @return the createDate
	 */
	public Date getCreateDate() {
		return createDate;
	}



	/**
	 * @param createDate the createDate to set
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}



	/**
	 * @return the lastModifiedBy
	 */
	public long getLastModifiedBy() {
		return lastModifiedBy;
	}



	/**
	 * @param lastModifiedBy the lastModifiedBy to set
	 */
	public void setLastModifiedBy(long lastModifiedBy) {
		this.lastModifiedBy = lastModifiedBy;
	}



	/**
	 * @return the lastModifyDate
	 */
	public Date getLastModifyDate() {
		return lastModifyDate;
	}



	/**
	 * @param lastModifyDate the lastModifyDate to set
	 */
	public void setLastModifyDate(Date lastModifyDate) {
		this.lastModifyDate = lastModifyDate;
	}



	/**
	 * @return the isSystemRecord
	 */
	public String getIsSystemRecord() {
		return isSystemRecord;
	}



	/**
	 * @param isSystemRecord the isSystemRecord to set
	 */
	public void setIsSystemRecord(String isSystemRecord) {
		this.isSystemRecord = isSystemRecord;
	}


	/**
	 * @return the addrList
	 */
	public List<AddressDetail> getAddrList() {
		return addrList;
	}



	/**
	 * @param addrList the addrList to set
	 */
	public void setAddrList(List<AddressDetail> addrList) {
		this.addrList = addrList;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj == null) return false;
		
		User userObj = (User)obj;
		if(userObj.getUserId() != getUserId()) return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("\n userId=" + userId);
		sb.append(",\n username=" + username);
		sb.append(",\n password=" + password);
		sb.append(",\n userTypeId=" + userTypeId);
		sb.append(",\n status=" + status);
		sb.append(",\n isAccountLocked=" + isAccountLocked);
		sb.append(",\n firstName=" + firstName);
		sb.append(",\n middleName=" + middleName);
		sb.append(",\n lastName=" + lastName);
		sb.append(",\n createdByUserId=" + createdBy);
		sb.append(",\n createDate=" + createDate);
		sb.append(",\n lastModifiedByUserId=" + lastModifiedBy);
		sb.append(",\n lastModifyDate=" + lastModifyDate);
		sb.append(",\n isSystemRecord=" + isSystemRecord);
		sb.append(",\n isActive=" + isActive);
		sb.append(",\n addrList=" + addrList);
		
		sb.append("\n");
		
		return sb.toString();
	}
	
}
